﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using BusinessObjects.BO_GetObjects;
using LibraryO2S;
using System.Web.UI.HtmlControls;

public partial class Controls_ucIntro : System.Web.UI.UserControl
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            LoadContent();
        }
    }

    protected void LoadContent()
    {
        DataTable objDT = BO_Articles.Search(12);
        if (objDT.Rows.Count > 0)
        {
            sActiveTitle.InnerText = objDT.Rows[0]["FULL_ARTICLE_TITLE"].ToString();
            content_detail.InnerHtml = objDT.Rows[0]["ARTICLE_DETAIL"].ToString();
            SetMetaTags(sActiveTitle.InnerText);
        }
        else
        {
            content_detail.InnerHtml = "<span style=\"color:red\">Dữ liệu đang được cập nhật!</span>";
        }
    }


    protected void SetMetaTags(string title)
    {
        MasterPage master = Page.Master;
        HtmlHead headTag = (HtmlHead)master.Page.Header;
        headTag.Title = "Luật Phúc Trung | " + title;
    }


}